#@adminLayout()

#define main()
  <main class="app-content">
    <div class="app-title">
      <div>
        <h1><i class="fa fa-th-list"></i>权限管理</h1>
        <p>Basic bootstrap tables</p>
      </div>
      <ul class="app-breadcrumb breadcrumb">
        <li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
        <li class="breadcrumb-item active"><a href="#">权限管理</a></li>
      </ul>
    </div>

    <div class="row">
      <div class="col-md-4">
        <div class="tile">
          <h3 class="tile-title">修改菜单</h3>
          <div class="tile-body">
            <form method="post" action="/admin/permission/permissionEdit" id="myArticleForm" >
              <input type="hidden" name="id" id="id"/>
              <div class="form-group">
                <label class="control-label">菜单控制器</label>
                <input class="form-control" type="text" name="actionKey" id="actionKey" placeholder="请输入菜单控制器" required="required" disabled>
              </div>
              <div class="form-group">
                <label class="control-label">菜单路由</label>
                <input class="form-control" type="text" name="controller" id="controller" placeholder="请输入菜单路由" required="required" disabled>
              </div>
              <div class="form-group">
                <label class="control-label">菜单备注</label>
                <input class="form-control" type="text" name="remark" id="remark" placeholder="请输入菜单备注" required="required">
              </div>
            </form>
          </div>
          <div class="tile-footer">
            <a class="btn btn-primary" href="javascript:;" onclick="permissionSave();"><i class="fa fa-fw fa-lg fa-check-circle"></i>提交</a>
            <p><font id="errorInfo" color="red"></font></p>
          </div>
        </div>
      </div>
      <div class="col-md-8">
        <div class="tile">
          <h3 class="tile-title">菜单列表</h3>
          <div class="table-responsive">
            <table class="table table-bordered">
              <thead>
                <tr>
                  <th>编号</th>
                  <th>控制器</th>
                  <th>备注</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
              #for(x : permissionPage.getList())
                <tr>
                  <td>#(x.id)</td>
                  <td>#(x.actionKey)</td>
                  <td>#(x.remark)</td>
                  <td>
                    <a class="btn btn-success" href="javascript:;" onclick="permissionEdit(#(x.id));"><i class="fa fa-lg fa-edit"></i>修改</a>
                  </td>
                </tr>
                #end
              </tbody>
            </table>
            <div>
                #@adminPaginate(permissionPage.pageNumber, permissionPage.totalPage, "/admin/permission?p=")
             </div>
          </div>
        </div>
      </div>
    </div>
  </main>
#end